/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/********************************************************************************************************
 *  \file     Adc_Fault.h                                                                               *
 *  \brief    This file contains interface header for ADC Fault injection.                              *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2023/08/15     <td>1.0.0                                                                     *
 * </table>                                                                                             *
 *******************************************************************************************************/

#ifndef ADC_FAULT_H
#define ADC_FAULT_H

#ifdef __cplusplus
extern "C" {
#endif
/********************************************************************************************************
 *                                 Global Macro definition                                              *
 *******************************************************************************************************/
/** \brief  ADC fault injection switch */
#ifndef ADC_FAULT_INJECTION
#define ADC_FAULT_INJECTION                                              (STD_OFF)
#endif

#if (ADC_FAULT_INJECTION == STD_OFF)
/** \brief  FUNCTION:Adc_InterruptEnableCheck() fault injection to store error status in int. */
#define AdcFaultInj_AdcFaultIntErrorStatus()
/** \brief  FUNCTION:Adc_InterruptEnableCheck() fault injection status register error. */
#define AdcFaultInj_Adc_InterruptEnableCheckIntSta(unitBase)
/** \brief  FUNCTION:Adc_InterruptEnableCheck() fault injection signal register error. */
#define AdcFaultInj_Adc_InterruptEnableCheckIntSig(unitBase)
/** \brief  FUNCTION:Adc_Ip_TriggerDisable() fault injection Dma stops error. */
#define AdcFaultInj_Adc_Ip_TriggerDisableDmaStopFail()
/** \brief  FUNCTION:Adc_Ip_TriggerEnable() fault injection Dma starts error. */
#define AdcFaultInj_Adc_Ip_TriggerEnableDmaStartFail()
/** \brief  FUNCTION:Adc_CheckValueMatch() fault injection value match failed. */
#define AdcFaultInj_Adc_CheckValueMatchFail()
/** \brief  FUNCTION:Adc_Ip_ConfigReset() fault injection init bit set time out. */
#define AdcFaultInj_Adc_Ip_ConfigResetFail()
/** \brief  FUNCTION:Adc_Ip_ConfigDma() fault injection dma get param error. */
#define AdcFaultInj_Adc_Ip_ConfigDmaGetParmFail()
/** \brief  FUNCTION:Adc_Ip_ConfigDma() fault injection request Dma channel error. */
#define AdcFaultInj_Adc_Ip_ConfigDmaReqChnlFail()
/** \brief  FUNCTION:Adc_Ip_ConfigDma() fault injection config Dma channel error. */
#define AdcFaultInj_Adc_Ip_ConfigDmaCfgChnlFail()
/** \brief  FUNCTION:Adc_GetHwCfgThroughPhysicalId() fault injection get NULL config error. */
#define AdcFaultInj_Adc_GetHwCfgThroughPhysicalIdGetNull()
/** \brief  FUNCTION:Adc_Ip_ClearFifo() fault injection read fifo empty error. */
#define AdcFaultInj_Adc_Ip_ClearFifoReadFail()
/** \brief  FUNCTION:Adc_Ip_ClearFifo() fault injection reset fifo error. */
#define AdcFaultInj_Adc_Ip_ClearFifoResetFail()
/** \brief  FUNCTION:Adc_Ip_StartApi fault injection. */
#define AdcFaultInj_Adc_Ip_StartInterruptPreemption()
/** \brief  FUNCTION:Adc_Ip_Start softwaretrigger not ready. */
#define AdcFaultInj_Adc_Ip_SoftwareTriggerStartFail()
/** \brief  FUNCTION:Adc_Ip_Start dma_start. */
#define AdcFaultInj_Adc_Ip_DmaStartFail()
/** \brief  FUNCTION:Adc_Ip_Start dma_stop. */
#define AdcFaultInj_Adc_Ip_DmaStopFail()
/** \brief  FUNCTION:Adc_Ip_Deinit Dma release. */
#define AdcFaultInj_Adc_Ip_DmaReleaseFail()
/** \brief  FUNCTION:Adc_Ip_TrimValue true. */
#define AdcFaultInj_Adc_Ip_TrimValueTrue()
/** \brief  FUNCTION:Adc_Ip_StartDmaTransmission fail. */
#define AdcFaultInj_Adc_Ip_StartDmaStatusFail()
/** \brief  FUNCTION:Adc_Ip_StartGroupConversion software reset. */
#define AdcFaultInj_Adc_Ip_SoftwareRst()
/** \brief  FUNCTION:Error core fault injection. */
#define AdcFaultInj_Adc_Ip_ErrorCore()
/** \brief  FUNCTION:Reset Gen error injection. */
#define AdcFaultInj_Adc_RstGenError()
/** \brief  FUNCTION:CkCkGen error injection. */
#define AdcFaultInj_Adc_CkGenError()
/** \brief  FUNCTION:polling overflow injection. */
#define AdcFaultInj_Adc_LoopPollingError()

#else
#include "Adc_UserFault.h"
extern volatile Adc_ErrorIdType Adc_IntErrorStatus;
#endif /* #if (ADC_FAULT_INJECTION == STD_OFF) */

#ifdef __cplusplus
}
#endif

#endif /* ADC_FAULT_H */
/* End of file */
